package com.baiyue.controller;


import com.baiyue.model.tableSet.TableSetDataRequest;
import com.baiyue.model.tableSet.TableSetDataResponse;
import com.baiyue.result.Result;
import com.baiyue.service.TableSetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 *
 * @author 伍波
 * @date 2024-04-30
 */
@RestController
@RequestMapping("/api/tableSet")
public class TableSetController {
    @Autowired
    private TableSetService tableSetService;

    @PostMapping("/add")
    public Result<Boolean> insertTableSet(@RequestBody TableSetDataRequest request){
        tableSetService.insertTableSet(request);
        return Result.success(true);
    }

    @PostMapping("/get")
    public Result<List<TableSetDataResponse>> getTableSetData(@RequestBody TableSetDataRequest request){
        return Result.success(tableSetService.getTableSetData(request));
    }
}

